package leetcode.offer;

/**
 * ClassName: ReverseLeftWords
 * Description: leetcode-剑指offer 58 - II 左旋转字符串
 * date: 2021-10-31 22:05
 *
 * @author liyifan
 */
public class ReverseLeftWords {
    public String reverseLeftWords(String s, int n) {
        char[] chars = s.toCharArray();
        StringBuffer buffer = new StringBuffer();
        for (int i = n;i < s.length();i++) {
            buffer.append(chars[i]);
        }
        for (int i = 0;i < n;i++) {
            buffer.append(chars[i]);
        }
        return buffer.toString();
    }
}
